Repository navigation
Dragon tags & mechs - #2620
Dragon tags & mechs#2620
Conversation
| if (!mechanism.hasValue()) { | ||
| battle.spawnNewGateway(); | ||
| } | ||
| if (mechanism.requireObject(LocationTag.class)) { |
| // --> | ||
| tagProcessor.registerMechanism("respawn_dragon", false, (object, mechanism) -> { | ||
| if (object.getWorld() == null) { | ||
| mechanism.echoError("World '" + object.world_name + "' is unloaded, cannot set respawn phase."); |
There was a problem hiding this comment.
... when is this a real concern?
| // <--[mechanism] | ||
| // @object WorldTag | ||
| // @name respawn_phase | ||
| // @input ElementTag(String) |
| // @returns ElementTag(Number) | ||
| // @description | ||
| // Returns the number of end gateway portals. | ||
| // Only works in end worlds. |
There was a problem hiding this comment.
Minor nitpick, but in sounds more like the player being in an end world while the script is running or something - maybe on, for, if the world is an end world, etc.?
| // @attribute <WorldTag.healing_crystals> | ||
| // @returns ListTag(EntityTag) | ||
| // @description | ||
| // Returns a ListTag of the healing crystals located on top of the obsidian towers. |
There was a problem hiding this comment.
I'd mention ender/end crystals as a search aid or in the description somewhere, healing crystals is technically right but most people probably won't know them by that name.
| }); | ||
|
|
||
| // <--[tag] | ||
| // @attribute <WorldTag.healing_crystals> |
| // @Plugin Paper | ||
| // @group paper | ||
| // @description | ||
| // If no location is specified, tries to spawn a new end gateway using default game mechanics. Otherwise, spawns a new end gateway portal at the specified location. |
There was a problem hiding this comment.
Nitpick, but meta is usually the other way around (spawns gateway at specified location, specify no input to spawn vanilla one)
| battle.spawnNewGateway(); | ||
| } | ||
| else if (mechanism.requireObject(LocationTag.class)) { | ||
| battle.spawnNewGateway(mechanism.getValue().asType(LocationTag.class, mechanism.context)); |
There was a problem hiding this comment.
There should be a #valueAsType iirc?
| // @name respawn_phase | ||
| // @input ElementTag | ||
| // @description | ||
| // Set the current respawn phase of the ender dragon. Valid phases can be found at <@link url https://jd.papermc.io/paper/1.20/org/bukkit/boss/DragonBattle.RespawnPhase.html> |
| tagProcessor.registerMechanism("respawn_phase", false, ElementTag.class, (object, mechanism, input) -> { | ||
| DragonBattle battle = object.getWorld().getEnderDragonBattle(); | ||
| if (battle == null) { | ||
| mechanism.echoError("Provided world is not an end world!"); | ||
| return; | ||
| } | ||
| battle.setRespawnPhase(input.asEnum(DragonBattle.RespawnPhase.class)); | ||
| }); |
|
|
||
| // <--[mechanism] | ||
| // @object WorldTag | ||
| // @name respawn_phase |
| tagProcessor.registerMechanism("first_dragon_killed", false, ElementTag.class, (object, mechanism, input) -> { | ||
| DragonBattle battle = object.getWorld().getEnderDragonBattle(); | ||
| if (battle == null) { | ||
| mechanism.echoError("Provided world is not an end world!"); | ||
| return; | ||
| } | ||
| battle.setPreviouslyKilled(input.asBoolean()); | ||
| }); |
| // Set whether the first ender dragon was killed already. | ||
| // Only works in end worlds. |
There was a problem hiding this comment.
Might be nice to document exactly what this does - does it reset the end and respawn the dragon? is it just a value that doesn't really affect anything?
| // <--[tag] | ||
| // @attribute <WorldTag.healing_crystals> | ||
| // @returns ListTag(EntityTag) | ||
| // @description | ||
| // Returns a ListTag of the healing end crystals located on top of the obsidian towers. | ||
| // Only works if the world is an end world. | ||
| // --> |
There was a problem hiding this comment.
These tags are missing the Paper plugin requirement/group meta
| // @attribute <WorldTag.respawn_crystals> | ||
| // @returns ListTag(EntityTag) | ||
| // @description | ||
| // Returns a ListTag of the respawn crystals located at the end exit portal. |
There was a problem hiding this comment.
Nitpick, but I'd probably mention end crystals here (like in the WorldTag.healing_crystals meta)
| // <--[mechanism] | ||
| // @object WorldTag | ||
| // @name first_dragon_killed | ||
| // @input ElementTag(Boolean) | ||
| // @description | ||
| // Set whether the first ender dragon was killed already. | ||
| // Toggling this value won't really affect anything in the end world, but may be useful when creating custom end worlds. | ||
| // Only works if the world is an end world. | ||
| // --> |
There was a problem hiding this comment.
Should have a tag link to first_dragon_killed (and vice versa)
gateway_counthealing_crystalsrespawn_crystalsspawn_gatewayfirst_dragon_killedrespawn_dragonreset_crystalsrespawn_phasefirst_dragon_killedI opened this as a draft PR because I haven't tested any of this/just wrote this up, and want it open so that I don't lose it in my sea of local and published branches. Feel free to comment/review though!